package com.ai.mall.controller.front;

import com.ai.mall.service.HotSearchesService;
import com.ai.mall.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/hot")
public class HotWordController {

    @Autowired
    private HotSearchesService hotSearchesService;

    // 获取热搜词列表接口
    @GetMapping("/hotWords")
    public R getHotWords() {
        // 这里应调用业务逻辑从数据源获取热搜词，示例返回固定列表
        List<String> hotWords = hotSearchesService.getHotWords();
        return R.ok().put("data", hotWords);
    }
}